#include "cone.h"

Cone::Cone(double r, double h)
{
    sh = sqrt(r * r + h * h);
}

Cone::Cone(const Cone& c)
{
    r = c.r;
    h = c.h;
    sh = c.sh;
}

double Cone::volume() const
{
    return (1.0 / 3.0) * PI * r * r * h;
}

double Cone::area() const
{
    return PI * r * r + PI * r * sh;
}